From 4af588e477fd2462e677543a8680a9d5590ebc40 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Tue, 23 Jul 2013 20:18:54 -0400 Subject: [PATCH] Getting started: Fix a corner case When using 'Words' without a loaded document, the example would crash. Thats not nice, so avoid it. --- examples/application8/exampleappwin.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/examples/application8/exampleappwin.c b/examples/application8/exampleappwin.c index d3f1cc5f8c..ea826166c6 100644 --- a/examples/application8/exampleappwin.c +++ b/examples/application8/exampleappwin.c @@ -89,6 +89,10 @@ update_words (ExampleAppWindow *win) priv = example_app_window_get_instance_private (win); tab = gtk_stack_get_visible_child (GTK_STACK (priv->stack)); + + if (tab == NULL) + return; + view = gtk_bin_get_child (GTK_BIN (tab)); buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view)); -- 2.30.2